# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=py3-usb
_pkgname=pyusb
pkgver=1.0.2
pkgrel=3
pkgdesc="PyUSB offers easy USB devices communication in Python3"
url="https://github.com/pyusb/pyusb"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/pyusb/pyusb/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-usb" # Backwards compatibility
provides="py-usb=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	cd tests
	python3 testall.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="6a264b796e17612004196a7a526a7c6df99feac9062f8354540221016411a78a65d413731aea2fc1206ed5ea2b84787078898b9ca3754164f1dfe2a9878b75a5  py3-usb-1.0.2.tar.gz"
